<template>
  <div id="app">
    <img alt="Vue logo" src="./assets/logo.png">
    <div class="input-container">
      <input v-model="inputValue" placeholder="请输入内容" />
    </div>
    <HelloWorld :msg="inputValue" @clear-input="clearInput" />
  </div>
</template>

<script>
import HelloWorld from './components/HelloWorld.vue'

export default {
  name: 'App',
  components: {
    HelloWorld
  },
  data() {
    return {
      inputValue: ''
    }
  },
  methods: {
    clearInput() {
      this.inputValue = '';
    }
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}

.input-container {
  margin-top: 20px; /* 调整输入框与图标的间距 */
}

.input-container input {
  width: 300px; /* 设置输入框的宽度 */
  padding: 10px; /* 设置输入框的内边距 */
  margin: 0 auto; /* 使输入框水平居中 */
  display: block; /* 使输入框成为块级元素 */
}
</style>